// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod iam {
    use crate::Result;

    /// A builder for [Iam][crate::client::Iam].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_iam_admin_v1::*;
    /// # use builder::iam::ClientBuilder;
    /// # use client::Iam;
    /// let builder : ClientBuilder = Iam::builder();
    /// let client = builder
    ///     .with_endpoint("https://iam.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::Iam;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = Iam;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::Iam] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [Iam::list_service_accounts][crate::client::Iam::list_service_accounts] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::ListServiceAccounts;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListServiceAccounts {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListServiceAccounts(RequestBuilder<crate::model::ListServiceAccountsRequest>);

    impl ListServiceAccounts {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListServiceAccountsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListServiceAccountsResponse> {
            (*self.0.stub)
                .list_service_accounts(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListServiceAccountsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListServiceAccountsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [name][crate::model::ListServiceAccountsRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListServiceAccountsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListServiceAccountsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListServiceAccounts {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::get_service_account][crate::client::Iam::get_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::GetServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetServiceAccount(RequestBuilder<crate::model::GetServiceAccountRequest>);

    impl GetServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccount> {
            (*self.0.stub)
                .get_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetServiceAccountRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::create_service_account][crate::client::Iam::create_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::CreateServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateServiceAccount(RequestBuilder<crate::model::CreateServiceAccountRequest>);

    impl CreateServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccount> {
            (*self.0.stub)
                .create_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::CreateServiceAccountRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [account_id][crate::model::CreateServiceAccountRequest::account_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_account_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.account_id = v.into();
            self
        }

        /// Sets the value of [service_account][crate::model::CreateServiceAccountRequest::service_account].
        pub fn set_service_account<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ServiceAccount>,
        {
            self.0.request.service_account = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [service_account][crate::model::CreateServiceAccountRequest::service_account].
        pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ServiceAccount>,
        {
            self.0.request.service_account = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::update_service_account][crate::client::Iam::update_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::UpdateServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateServiceAccount(RequestBuilder<crate::model::ServiceAccount>);

    impl UpdateServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ServiceAccount>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccount> {
            (*self.0.stub)
                .update_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::ServiceAccount::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [project_id][crate::model::ServiceAccount::project_id].
        pub fn set_project_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project_id = v.into();
            self
        }

        /// Sets the value of [unique_id][crate::model::ServiceAccount::unique_id].
        pub fn set_unique_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.unique_id = v.into();
            self
        }

        /// Sets the value of [email][crate::model::ServiceAccount::email].
        pub fn set_email<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.email = v.into();
            self
        }

        /// Sets the value of [display_name][crate::model::ServiceAccount::display_name].
        pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.display_name = v.into();
            self
        }

        /// Sets the value of [etag][crate::model::ServiceAccount::etag].
        #[deprecated]
        pub fn set_etag<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
            self.0.request.etag = v.into();
            self
        }

        /// Sets the value of [description][crate::model::ServiceAccount::description].
        pub fn set_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.description = v.into();
            self
        }

        /// Sets the value of [oauth2_client_id][crate::model::ServiceAccount::oauth2_client_id].
        pub fn set_oauth2_client_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.oauth2_client_id = v.into();
            self
        }

        /// Sets the value of [disabled][crate::model::ServiceAccount::disabled].
        pub fn set_disabled<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.disabled = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::patch_service_account][crate::client::Iam::patch_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::PatchServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> PatchServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct PatchServiceAccount(RequestBuilder<crate::model::PatchServiceAccountRequest>);

    impl PatchServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::PatchServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccount> {
            (*self.0.stub)
                .patch_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [service_account][crate::model::PatchServiceAccountRequest::service_account].
        pub fn set_service_account<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ServiceAccount>,
        {
            self.0.request.service_account = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [service_account][crate::model::PatchServiceAccountRequest::service_account].
        pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ServiceAccount>,
        {
            self.0.request.service_account = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::PatchServiceAccountRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::PatchServiceAccountRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for PatchServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::delete_service_account][crate::client::Iam::delete_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::DeleteServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteServiceAccount(RequestBuilder<crate::model::DeleteServiceAccountRequest>);

    impl DeleteServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteServiceAccountRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::undelete_service_account][crate::client::Iam::undelete_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::UndeleteServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UndeleteServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UndeleteServiceAccount(RequestBuilder<crate::model::UndeleteServiceAccountRequest>);

    impl UndeleteServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UndeleteServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::UndeleteServiceAccountResponse> {
            (*self.0.stub)
                .undelete_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UndeleteServiceAccountRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UndeleteServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::enable_service_account][crate::client::Iam::enable_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::EnableServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> EnableServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct EnableServiceAccount(RequestBuilder<crate::model::EnableServiceAccountRequest>);

    impl EnableServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::EnableServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .enable_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::EnableServiceAccountRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for EnableServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::disable_service_account][crate::client::Iam::disable_service_account] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::DisableServiceAccount;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DisableServiceAccount {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DisableServiceAccount(RequestBuilder<crate::model::DisableServiceAccountRequest>);

    impl DisableServiceAccount {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DisableServiceAccountRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .disable_service_account(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DisableServiceAccountRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DisableServiceAccount {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::list_service_account_keys][crate::client::Iam::list_service_account_keys] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::ListServiceAccountKeys;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListServiceAccountKeys {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListServiceAccountKeys(RequestBuilder<crate::model::ListServiceAccountKeysRequest>);

    impl ListServiceAccountKeys {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListServiceAccountKeysRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListServiceAccountKeysResponse> {
            (*self.0.stub)
                .list_service_account_keys(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::ListServiceAccountKeysRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [key_types][crate::model::ListServiceAccountKeysRequest::key_types].
        pub fn set_key_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::list_service_account_keys_request::KeyType>,
        {
            use std::iter::Iterator;
            self.0.request.key_types = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListServiceAccountKeys {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::get_service_account_key][crate::client::Iam::get_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::GetServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetServiceAccountKey(RequestBuilder<crate::model::GetServiceAccountKeyRequest>);

    impl GetServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccountKey> {
            (*self.0.stub)
                .get_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetServiceAccountKeyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [public_key_type][crate::model::GetServiceAccountKeyRequest::public_key_type].
        pub fn set_public_key_type<T: Into<crate::model::ServiceAccountPublicKeyType>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.public_key_type = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::create_service_account_key][crate::client::Iam::create_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::CreateServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateServiceAccountKey(
        RequestBuilder<crate::model::CreateServiceAccountKeyRequest>,
    );

    impl CreateServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccountKey> {
            (*self.0.stub)
                .create_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::CreateServiceAccountKeyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [private_key_type][crate::model::CreateServiceAccountKeyRequest::private_key_type].
        pub fn set_private_key_type<T: Into<crate::model::ServiceAccountPrivateKeyType>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.private_key_type = v.into();
            self
        }

        /// Sets the value of [key_algorithm][crate::model::CreateServiceAccountKeyRequest::key_algorithm].
        pub fn set_key_algorithm<T: Into<crate::model::ServiceAccountKeyAlgorithm>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.key_algorithm = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::upload_service_account_key][crate::client::Iam::upload_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::UploadServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UploadServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UploadServiceAccountKey(
        RequestBuilder<crate::model::UploadServiceAccountKeyRequest>,
    );

    impl UploadServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UploadServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ServiceAccountKey> {
            (*self.0.stub)
                .upload_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UploadServiceAccountKeyRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [public_key_data][crate::model::UploadServiceAccountKeyRequest::public_key_data].
        pub fn set_public_key_data<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
            self.0.request.public_key_data = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UploadServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::delete_service_account_key][crate::client::Iam::delete_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::DeleteServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteServiceAccountKey(
        RequestBuilder<crate::model::DeleteServiceAccountKeyRequest>,
    );

    impl DeleteServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteServiceAccountKeyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::disable_service_account_key][crate::client::Iam::disable_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::DisableServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DisableServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DisableServiceAccountKey(
        RequestBuilder<crate::model::DisableServiceAccountKeyRequest>,
    );

    impl DisableServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DisableServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .disable_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DisableServiceAccountKeyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DisableServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::enable_service_account_key][crate::client::Iam::enable_service_account_key] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::EnableServiceAccountKey;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> EnableServiceAccountKey {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct EnableServiceAccountKey(
        RequestBuilder<crate::model::EnableServiceAccountKeyRequest>,
    );

    impl EnableServiceAccountKey {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::EnableServiceAccountKeyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .enable_service_account_key(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::EnableServiceAccountKeyRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for EnableServiceAccountKey {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::sign_blob][crate::client::Iam::sign_blob] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::SignBlob;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SignBlob {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SignBlob(RequestBuilder<crate::model::SignBlobRequest>);

    impl SignBlob {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SignBlobRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SignBlobResponse> {
            (*self.0.stub)
                .sign_blob(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::SignBlobRequest::name].
        ///
        /// This is a **required** field for requests.
        #[deprecated]
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [bytes_to_sign][crate::model::SignBlobRequest::bytes_to_sign].
        ///
        /// This is a **required** field for requests.
        #[deprecated]
        pub fn set_bytes_to_sign<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
            self.0.request.bytes_to_sign = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SignBlob {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::sign_jwt][crate::client::Iam::sign_jwt] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::SignJwt;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SignJwt {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SignJwt(RequestBuilder<crate::model::SignJwtRequest>);

    impl SignJwt {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SignJwtRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SignJwtResponse> {
            (*self.0.stub)
                .sign_jwt(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::SignJwtRequest::name].
        ///
        /// This is a **required** field for requests.
        #[deprecated]
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [payload][crate::model::SignJwtRequest::payload].
        ///
        /// This is a **required** field for requests.
        #[deprecated]
        pub fn set_payload<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.payload = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SignJwt {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::get_iam_policy][crate::client::Iam::get_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::GetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIamPolicy(RequestBuilder<iam_v1::model::GetIamPolicyRequest>);

    impl GetIamPolicy {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::GetIamPolicyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::Policy> {
            (*self.0.stub)
                .get_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::GetIamPolicyRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [options][iam_v1::model::GetIamPolicyRequest::options].
        pub fn set_options<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
        {
            self.0.request.options = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [options][iam_v1::model::GetIamPolicyRequest::options].
        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<iam_v1::model::GetPolicyOptions>,
        {
            self.0.request.options = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::set_iam_policy][crate::client::Iam::set_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::SetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SetIamPolicy(RequestBuilder<iam_v1::model::SetIamPolicyRequest>);

    impl SetIamPolicy {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::SetIamPolicyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::Policy> {
            (*self.0.stub)
                .set_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::SetIamPolicyRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
        ///
        /// This is a **required** field for requests.
        pub fn set_policy<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<iam_v1::model::Policy>,
        {
            self.0.request.policy = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [policy][iam_v1::model::SetIamPolicyRequest::policy].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<iam_v1::model::Policy>,
        {
            self.0.request.policy = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][iam_v1::model::SetIamPolicyRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::test_iam_permissions][crate::client::Iam::test_iam_permissions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::TestIamPermissions;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TestIamPermissions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TestIamPermissions(RequestBuilder<iam_v1::model::TestIamPermissionsRequest>);

    impl TestIamPermissions {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<iam_v1::model::TestIamPermissionsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<iam_v1::model::TestIamPermissionsResponse> {
            (*self.0.stub)
                .test_iam_permissions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][iam_v1::model::TestIamPermissionsRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [permissions][iam_v1::model::TestIamPermissionsRequest::permissions].
        ///
        /// This is a **required** field for requests.
        pub fn set_permissions<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TestIamPermissions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::query_grantable_roles][crate::client::Iam::query_grantable_roles] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::QueryGrantableRoles;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> QueryGrantableRoles {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct QueryGrantableRoles(RequestBuilder<crate::model::QueryGrantableRolesRequest>);

    impl QueryGrantableRoles {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::QueryGrantableRolesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QueryGrantableRolesResponse> {
            (*self.0.stub)
                .query_grantable_roles(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::QueryGrantableRolesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::QueryGrantableRolesResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [full_resource_name][crate::model::QueryGrantableRolesRequest::full_resource_name].
        ///
        /// This is a **required** field for requests.
        pub fn set_full_resource_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.full_resource_name = v.into();
            self
        }

        /// Sets the value of [view][crate::model::QueryGrantableRolesRequest::view].
        pub fn set_view<T: Into<crate::model::RoleView>>(mut self, v: T) -> Self {
            self.0.request.view = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::QueryGrantableRolesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::QueryGrantableRolesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for QueryGrantableRoles {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::list_roles][crate::client::Iam::list_roles] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::ListRoles;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListRoles {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListRoles(RequestBuilder<crate::model::ListRolesRequest>);

    impl ListRoles {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListRolesRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListRolesResponse> {
            (*self.0.stub)
                .list_roles(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListRolesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRolesResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListRolesRequest::parent].
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListRolesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListRolesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [view][crate::model::ListRolesRequest::view].
        pub fn set_view<T: Into<crate::model::RoleView>>(mut self, v: T) -> Self {
            self.0.request.view = v.into();
            self
        }

        /// Sets the value of [show_deleted][crate::model::ListRolesRequest::show_deleted].
        pub fn set_show_deleted<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.show_deleted = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListRoles {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::get_role][crate::client::Iam::get_role] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::GetRole;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetRole {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetRole(RequestBuilder<crate::model::GetRoleRequest>);

    impl GetRole {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetRoleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Role> {
            (*self.0.stub)
                .get_role(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetRoleRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetRole {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::create_role][crate::client::Iam::create_role] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::CreateRole;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateRole {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateRole(RequestBuilder<crate::model::CreateRoleRequest>);

    impl CreateRole {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateRoleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Role> {
            (*self.0.stub)
                .create_role(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateRoleRequest::parent].
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [role_id][crate::model::CreateRoleRequest::role_id].
        pub fn set_role_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.role_id = v.into();
            self
        }

        /// Sets the value of [role][crate::model::CreateRoleRequest::role].
        pub fn set_role<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Role>,
        {
            self.0.request.role = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [role][crate::model::CreateRoleRequest::role].
        pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Role>,
        {
            self.0.request.role = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateRole {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::update_role][crate::client::Iam::update_role] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::UpdateRole;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateRole {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateRole(RequestBuilder<crate::model::UpdateRoleRequest>);

    impl UpdateRole {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateRoleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Role> {
            (*self.0.stub)
                .update_role(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UpdateRoleRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [role][crate::model::UpdateRoleRequest::role].
        pub fn set_role<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Role>,
        {
            self.0.request.role = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [role][crate::model::UpdateRoleRequest::role].
        pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Role>,
        {
            self.0.request.role = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateRoleRequest::update_mask].
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateRoleRequest::update_mask].
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateRole {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::delete_role][crate::client::Iam::delete_role] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::DeleteRole;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteRole {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteRole(RequestBuilder<crate::model::DeleteRoleRequest>);

    impl DeleteRole {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteRoleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Role> {
            (*self.0.stub)
                .delete_role(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteRoleRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [etag][crate::model::DeleteRoleRequest::etag].
        pub fn set_etag<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
            self.0.request.etag = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteRole {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::undelete_role][crate::client::Iam::undelete_role] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::UndeleteRole;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UndeleteRole {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UndeleteRole(RequestBuilder<crate::model::UndeleteRoleRequest>);

    impl UndeleteRole {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UndeleteRoleRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Role> {
            (*self.0.stub)
                .undelete_role(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::UndeleteRoleRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [etag][crate::model::UndeleteRoleRequest::etag].
        pub fn set_etag<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
            self.0.request.etag = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UndeleteRole {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::query_testable_permissions][crate::client::Iam::query_testable_permissions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::QueryTestablePermissions;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> QueryTestablePermissions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct QueryTestablePermissions(
        RequestBuilder<crate::model::QueryTestablePermissionsRequest>,
    );

    impl QueryTestablePermissions {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::QueryTestablePermissionsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QueryTestablePermissionsResponse> {
            (*self.0.stub)
                .query_testable_permissions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<
            crate::model::QueryTestablePermissionsResponse,
            gax::error::Error,
        > {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::QueryTestablePermissionsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [full_resource_name][crate::model::QueryTestablePermissionsRequest::full_resource_name].
        pub fn set_full_resource_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.full_resource_name = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::QueryTestablePermissionsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::QueryTestablePermissionsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for QueryTestablePermissions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::query_auditable_services][crate::client::Iam::query_auditable_services] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::QueryAuditableServices;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> QueryAuditableServices {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct QueryAuditableServices(RequestBuilder<crate::model::QueryAuditableServicesRequest>);

    impl QueryAuditableServices {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::QueryAuditableServicesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QueryAuditableServicesResponse> {
            (*self.0.stub)
                .query_auditable_services(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [full_resource_name][crate::model::QueryAuditableServicesRequest::full_resource_name].
        pub fn set_full_resource_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.full_resource_name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for QueryAuditableServices {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [Iam::lint_policy][crate::client::Iam::lint_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_iam_admin_v1::builder;
    /// use builder::iam::LintPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> LintPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct LintPolicy(RequestBuilder<crate::model::LintPolicyRequest>);

    impl LintPolicy {
        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Iam>) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::LintPolicyRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::LintPolicyResponse> {
            (*self.0.stub)
                .lint_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [full_resource_name][crate::model::LintPolicyRequest::full_resource_name].
        pub fn set_full_resource_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.full_resource_name = v.into();
            self
        }

        /// Sets the value of [lint_object][crate::model::LintPolicyRequest::lint_object].
        ///
        /// Note that all the setters affecting `lint_object` are
        /// mutually exclusive.
        pub fn set_lint_object<T: Into<Option<crate::model::lint_policy_request::LintObject>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.lint_object = v.into();
            self
        }

        /// Sets the value of [lint_object][crate::model::LintPolicyRequest::lint_object]
        /// to hold a `Condition`.
        ///
        /// Note that all the setters affecting `lint_object` are
        /// mutually exclusive.
        pub fn set_condition<T: std::convert::Into<std::boxed::Box<gtype::model::Expr>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_condition(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for LintPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
